<style>
	input[type=text]{
		padding:10px;
		font-weight:bold;
		font-size:20px;
		border:none;
		word-spacing:10px;
		letter-spacing:2px;
		width:100px;
		display:inline-block;
		text-align:center;
	}
</style>
<?=$system_message;?>
<div class="panel">Grading System</div>
<div class="section-container auto" data-section data-options="deep_linking: true">
	<section class="active">
		<p class="title" data-section-title><a href="#elem">Elementary Grading System</a></p>
		<div class="content" data-slug="elem" data-section-content>
			<?
				$names = ['aplus','aflat','aminus','bplus','bflat','bminus','cplus','cflat','cminus','dflat','ng'];
				if($gd)
				{
					foreach($gd as $k => $v)
					{
						${$k.'_fromval'} = $v['rangefrom'];
						${$k.'_toval'} = $v['rangeto'];
					    // ${$k.'_from'} = $k.'['.$k.'_from]['.$v['id'].']';
					    // ${$k.'_to'} = $k.'['.$k.'_to]['.$v['id'].']';
						
						${$k.'_from'} = $v['id'].'['.$k.'_from]';
					   ${$k.'_to'} = $v['id'].'['.$k.'_to]';
					}
				
				}else{
					foreach($names as $v)
					{
						${$v.'_fromval'} = '';
						${$v.'_toval'} = '';
						${$v.'_from'} = 'data['.$v.']['.$v.'_from]';
						${$v.'_to'} = 'data['.$v.']['.$v.'_to]';
					}
				}
			?>
			<table class="table table-striped">
				<form action="<?=site_url('room_section_subject/grading_system');?>" method="POST" autocomplete="off">
				<tr>
					<td><input type="text" value="A+" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$aplus_from;?>" placeholder="from" value="<?=set_value('aplus',$aplus_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$aplus_to;?>" placeholder="to" value="<?=set_value('aplus',$aplus_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="A" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$aflat_from;?>" placeholder="from" value="<?=set_value('aflat',$aflat_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$aflat_to;?>" placeholder="to" value="<?=set_value('aflat',$aflat_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="A-" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$aminus_from;?>" placeholder="from" value="<?=set_value('aminus',$aminus_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$aminus_to;?>" placeholder="to" value="<?=set_value('aminus',$aminus_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="B+" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$bplus_from;?>" placeholder="from" value="<?=set_value('bplus',$bplus_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$bplus_to;?>" placeholder="to" value="<?=set_value('bplus',$bplus_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="B" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$bflat_from;?>" placeholder="from" value="<?=set_value('bflat',$bflat_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$bflat_to;?>" placeholder="to" value="<?=set_value('bflat',$bflat_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="B-" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$bminus_from;?>" placeholder="from" value="<?=set_value('bminus',$bminus_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$bminus_to;?>" placeholder="to" value="<?=set_value('bminus',$bminus_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="C+" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$cplus_from;?>" placeholder="from" value="<?=set_value('cplus',$cplus_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$cplus_to;?>" placeholder="to" value="<?=set_value('cplus',$cplus_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="C" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$cflat_from;?>" placeholder="from" value="<?=set_value('cflat',$cflat_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$cflat_to;?>" placeholder="to" value="<?=set_value('cflat',$cflat_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="C-" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$cminus_from;?>" placeholder="from" value="<?=set_value('cminus',$cminus_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$cminus_to;?>" placeholder="to" value="<?=set_value('cminus',$cminus_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="D" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$dflat_from;?>" placeholder="from" value="<?=set_value('dflat',$dflat_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$dflat_to;?>" placeholder="to" value="<?=set_value('dflat',$dflat_toval);?>">
					</td>
				</tr>
				<tr>
					<td><input type="text" value="NG" disabled></td>
					<td><span><i class="icon-arrow-right"></i></span></td>
					<td>
						<input type="text" name="<?=$ng_from;?>" placeholder="from" value="<?=set_value('ngrade',$ng_fromval);?>"><span><i class="icon-minus"></i></span>
						<input type="text" name="<?=$ng_to;?>" placeholder="to" value="<?=set_value('ngrade',$ng_toval);?>">
					</td>
				</tr>
				<tr>
					<?if($gd):?>
						<td colspan="3"><input type="submit" name="update_grading_period" class="btn btn-primary" value="Save"></td>
					<?else:?>
						<td colspan="3"><input type="submit" name="create_grading_period" class="btn btn-success" value="Save"></td>
					<?endif;?>
				</tr>
				</form>
			</table>
		</div>
	</section>
	<section>
		<p class="title" data-section-title><a href="#kind">Kinder</a></p>
		<div class="content" data-slug="kind" data-section-content>
		<table class="table">
			<tr>
				<td><h4>Hooray</h4></td>
				<td><code>yellow</code></td>
				<td><img src="<?=image_url('symb-yellow.png');?>" width="100" ></td>
			<tr>
				<tr>
				<td><h4>Nice</h4></td>
				<td><code>red</code></td>
				<td><img src="<?=image_url('symb-red.png');?>" width="100" ></td>
			<tr>
				<tr>
				<td><h4>Good</h4></td>
				<td><code>blue</code></td>
				<td><img src="<?=image_url('symb-blue.png');?>" width="100" ></td>
			<tr>
				<tr>
				<td><h4>Can Do Better</h4></td>
				<td><code>green</code></td>
				<td><img src="<?=image_url('symb-green.png');?>" width="100" ></td>
			<tr>
				<tr>
				<td><h4>Help</h4></td>
				<td><code>orange</code></td>
				<td><img src="<?=image_url('symb-orange.png');?>" width="100" ></td>
			<tr>
		</table>
		</div>
	</section>
</div>